package com.qs.tx;

import com.qs.tx.config.TxConfig;
import com.qs.tx.entity.Account;
import com.qs.tx.service.AccountService;
import org.springframework.context.annotation.AnnotationConfigApplicationContext;

public class TransactionTest {

	public static void main(String[] args) {
		AnnotationConfigApplicationContext applicationContext = new AnnotationConfigApplicationContext();
		applicationContext.register(TxConfig.class);
		applicationContext.refresh();

		AccountService accountService = (AccountService) applicationContext.getBean("accountService");
		System.out.println("==>>");
		System.out.println(accountService);

		Account account = new Account();
		account.setAccountName("张三");
		account.setAmount(1000d);
		accountService.insertAccount(account);
	}
}
